<?php
class Mail {
    /**
     * send mail by smtp
     * @param string $toEmail
     * @param string $subject
     * @param string $body
     * @param bool $out
     * @param string $fromEmail
     * @param string $mailType, HTML or TEXT
     * @return bool
     */
	public static function sendMail($toEmail, $subject, $body, $out=FALSE, 
	                       $fromEmail, $mailType='HTML') {
	    //mail setting
	    define('SMTPSERVER', 'smtp.sina.com');
	    define('SMTPPORT', 25); 
	    define('MAILUSER', 'test@sina.com'); 
	    define('MAILPASSWD', 'test');
	    define('MAILSENDER', MAILUSER);	     
	                        
		$smtp = new BaseModelSMTP(SMTPSERVER, SMTPPORT, true, MAILUSER, MAILPASSWD, 
		            $fromEmail);
		            
		$ret = $smtp->sendmail($toEmail, $fromEmail, $subject, $body, $mailType);
		
		return ($ret == 1) ? true : false;
	}
}
?>